package net.oschina.app.previousTest;

import android.test.ActivityInstrumentationTestCase2;
import android.view.View;

import com.robotium.solo.Solo;

import junit.framework.Assert;

import net.oschina.app.AppStart;

/**
 * Created by Administrator on 2017/6/30.
 */

public class SearchTest extends ActivityInstrumentationTestCase2 {

    private Solo solo;

    public SearchTest() {
        super(AppStart.class);
    }

    @Override
    public void setUp() throws Exception {
        super.setUp();
        solo = new Solo(getInstrumentation(), getActivity());
    }

    public void testName() throws Exception {
        solo.clickOnText("我的");
        solo.clickOnText("点击头像登录");
        solo.clearEditText(0);
        solo.enterText(0,"robotium2016@163.com");
        solo.clearEditText(1);
        solo.enterText(1,"123456a");
        solo.clickOnText("登录");
        // 断言  第一个 一定能等到“uiautomator2”,等待5s
        Assert.assertTrue(solo.waitForText("uiautomator2",1,5000));
    }

    @Override
    public void tearDown() throws Exception {
        solo.finishOpenedActivities();
        super.tearDown();
    }
}
